Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add insecure data plane #127

Merged
merged 3 commits into from
Dec 15, 2020
Merged

feat: add insecure data plane #127

merged 3 commits into from
Dec 15, 2020

Conversation

craicoverflow
Copy link
Contributor

@craicoverflow craicoverflow commented Dec 8, 2020

DO NOT MERGE

Verification is on hold until we have a staging environment to test this against. The local mock in use does not have SSL enabled.

Resolves #122

@craicoverflow
Copy link
Contributor Author

@wtrocki to get this to work with the mock, my clusterHost is localhost:9092, and the confluentinc/cp-kafka container is running. Getting:

❯ rhoas kafka topics list --insecure
Topics:
panic: dial tcp [::1]:9092: connect: connection refused

goroutine 1 [running]:
github.com/bf2fc6cc711aee1a0c2a/cli/pkg/sdk/kafka/topics.brokerConnect(0xc000417c01, 0x4df9b7, 0x4862c5)
	/home/ephelan/code/github.com/bf2fc6cc711aee1a0c2a/cli/pkg/sdk/kafka/topics/topics.go:53 +0x4e6
github.com/bf2fc6cc711aee1a0c2a/cli/pkg/sdk/kafka/topics.ListKafkaTopics(0x1924e01, 0x0, 0x0)
	/home/ephelan/code/github.com/bf2fc6cc711aee1a0c2a/cli/pkg/sdk/kafka/topics/topics.go:88 +0x65
github.com/bf2fc6cc711aee1a0c2a/cli/pkg/cmd/kafka/topics/list.listTopic(0x1)
	/home/ephelan/code/github.com/bf2fc6cc711aee1a0c2a/cli/pkg/cmd/kafka/topics/list/list.go:35 +0x86
github.com/bf2fc6cc711aee1a0c2a/cli/pkg/cmd/kafka/topics/list.NewListTopicCommand.func1(0xc000430840, 0xc0003f4df0, 0x0, 0x1)
	/home/ephelan/code/github.com/bf2fc6cc711aee1a0c2a/cli/pkg/cmd/kafka/topics/list/list.go:23 +0x2c
github.com/spf13/cobra.(*Command).execute(0xc000430840, 0xc0003f4de0, 0x1, 0x1, 0xc000430840, 0xc0003f4de0)
	/home/ephelan/go/pkg/mod/github.com/spf13/[email protected]/command.go:854 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xc0003a0580, 0x5, 0xc0003a0580, 0xc000417f60)
	/home/ephelan/go/pkg/mod/github.com/spf13/[email protected]/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/ephelan/go/pkg/mod/github.com/spf13/[email protected]/command.go:895
main.main()
	/home/ephelan/code/github.com/bf2fc6cc711aee1a0c2a/cli/cmd/rhoas/main.go:29 +0x14c

I will not have the opportunity to look at this for another couple of hours, it is probably something small.

@wtrocki
Copy link
Collaborator

wtrocki commented Dec 8, 2020

@craicoverflow Does it work with production?

@craicoverflow
Copy link
Contributor Author

@craicoverflow Does it work with production?

Without a client, can this be tested against production?

@wtrocki
Copy link
Collaborator

wtrocki commented Dec 8, 2020

Yep.. Just swap refresh token in your config to the offline token from openshift/token page.
All works there (however this is not something we want people to do or document)
Login flow doesn't affect server authz.

@wtrocki
Copy link
Collaborator

wtrocki commented Dec 8, 2020

Rebased.

@@ -23,12 +24,17 @@ func brokerConnect() (broker *kafka.Conn, ctl *kafka.Conn) {
dialer := &kafka.Dialer{
Timeout: 100 * time.Second,
DualStack: true,
// #nosec 402
TLS: &tls.Config{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So trick is that if we want CLI to work with any kafka we will need to dynamically add tls... but generally our kafka always have tls so it can stay and we can just use insecure option
This should be added only when insecure is present.

@wtrocki
Copy link
Collaborator

wtrocki commented Dec 8, 2020

I have tried this and it looks like this is not working. We are still blocked by cert.

Error I'm getting:

wtrockites--lnxsx-kq--x-diopfktgelbidh.apps.ms-bum08kn170hh.05zq.s1.devshift.org:443
panic: multiple Read calls return no data or error

goroutine 1 [running]:
github.com/bf2fc6cc711aee1a0c2a/cli/pkg/sdk/kafka/topics.brokerConnect(0xc0003b5800, 0xc000439bf0, 0xc00049bc60)
        /Users/wtrocki/Projects/mas/mas-devexp/rhmas/pkg/sdk/kafka/topics/topics.go:59 +0x4f0
github.com/bf2fc6cc711aee1a0c2a/cli/pkg/sdk/kafka/topics.CreateKafkaTopic(0xc00049bcb0, 0xc00049bd00, 0x0, 0x0)
        /Users/wtrocki/Projects/mas/mas-devexp/rhmas/pkg/sdk/kafka/topics/topics.go:71 +0x48

I would see if we can get this problem fixed on server side (I heard that tomorrow this should work with valid cert).

CC @pmuir

@pmuir
Copy link
Collaborator

pmuir commented Dec 14, 2020

Verified this works.

@craicoverflow craicoverflow merged commit 8ca363b into master Dec 15, 2020
@craicoverflow craicoverflow deleted the insecure-topics branch December 15, 2020 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add flag to the kafka topics command to ignore invalid/self signed certs
3 participants